package com.soft.javase.day10.practice.stream1;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/5/4
 */
public class TeamProcess {
    public static void main(String[] args) {
        List<String> team1 = Arrays.asList("王麻子","老子","李小龙", "庄子", "洪七公","孔子","张三丰");
        List<String> team2 = Arrays.asList("张明","张无忌", "张三丰","吕布","张二狗","张三");

        Stream<String> stream1 = team1.stream()
                .filter(name -> name.length() == 3)
                .limit(3);

        Stream<String> stream2 = team2.stream()
                .filter(name -> name.startsWith("张"))
                .skip(2);

        Stream.concat(stream1, stream2)
                .map(name -> new Person(name, 0))
                .forEach(System.out::println);
    }
}
